<include file="Public/min-header" />
<script type="text/javascript">
    window.UEDITOR_Admin_URL = "__ROOT__/Public/plugins/Ueditor/";
    var URL_upload = "{$URL_upload}";
    var URL_fileUp = "{$URL_fileUp}";
    var URL_scrawlUp = "{$URL_scrawlUp}";
    var URL_getRemoteImage = "{$URL_getRemoteImage}";
    var URL_imageManager = "{$URL_imageManager}";
    var URL_imageUp = "{$URL_imageUp}";
    var URL_getMovie = "{$URL_getMovie}";
    var URL_home = "{$URL_home}";
</script>
<load href="__ROOT__/Public/plugins/Ueditor/ueditor.config.js" />
<load href="__ROOT__/Public/plugins/Ueditor/ueditor.all.js" />
<link href="__PUBLIC__/plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />
<script src="__PUBLIC__/plugins/daterangepicker/moment.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script>
<div class="wrapper">
    <include file="Public/breadcrumb" />
    <section class="content">
        <div class="container-fluid">
            <div class="pull-right">
                <a href="javascript:history.go(-1)" data-toggle="tooltip" title="" class="btn btn-default pull-right" data-original-title="返回"><i class="fa fa-reply"></i></a>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><i class="fa fa-list"></i>问题信息</h3>
                </div>
                <div class="panel-body">
                    <form action="{:U('qa/handle')}" method="post" >
                        <table class="table table-bordered">
                            <tbody>
                                <tr>
                                    <td class="col-sm-1 text-right">标题:</td>
                                    <td>
                                        <input type="text" class="form-control" name="info[title]" value="{$info.title}">
                                    </td>
                                    <td></td>
                                </tr>

                                <tr>
                                    <td class="col-sm-1 text-right">标题补充:</td>
                                    <td>
                                        <textarea  class="form-control" name="info[desc]">{$info.desc}</textarea>
                                    </td>
                                    <td></td>
                                </tr>

                                <tr>
                                    <td class="col-sm-1 text-right">提问者:</td>
                                    <td>
                                        <select name="info[user_id]" class="form-control" >
                                            <volist name="users" id="vo">
                                                <option value="{$vo.user_id}" <if condition="$vo[user_id] eq $info[user_id]">selected</if>>{$vo.username}[{$vo.mobile}]</option>
                                            </volist>
                                        </select>
                                    </td>
                                    <td></td>
                                </tr>

                                <tr>
                                    <td class="col-sm-1 text-right">专业类型:</td>
                                    <td>
                                        <select name="info[cat_ids][]" class="form-control" multiple >
                                            <option value="">请选择</option>
                                            <volist name="cat_ids" id="vo">
                                                <option value="{$key}" <in name="key" value="$info.cat_ids">selected</in> >{$vo}</option>
                                            </volist>
                                        </select>
                                    </td>
                                    <td></td>
                                </tr>

                                <tr>
                                    <td class="col-sm-1 text-right">截止时间:</td>
                                    <td>
                                        <input type="text" class="form-control" id="stop_time"  name="info[stop_time]" value="{$info.stop_time|date='Y-m-d H:i:s',###}">
                                    </td>
                                    <td></td>
                                </tr>


                                <tr>
                                <td class = "text-right">是否开启悬赏:</td>
                                <td>
                            <input name="info[open_reward]" type="radio" value="1" <if condition="$info['open_reward'] eq 1">checked</if> >是
                            <input name="info[open_reward]" type="radio" value="0" <if condition="$info['open_reward'] eq 0">checked</if> >否
                            </td>
                            <td></td>
                            </tr>

                                <tr>
                                    <td class="col-sm-1 text-right">悬赏金额:</td>
                                    <td>
                                        <input type="text" class="form-control" name="info[reward_money]" value="{$info.reward_money}">
                                    </td>
                                    <td></td>
                                </tr>

                                <tr>
                                    <td class="col-sm-1 text-right">阅读量:</td>
                                    <td>
                                        <input type="text" class="form-control" name="info[read_num]" value="{$info.read_num}">
                                    </td>
                                    <td></td>
                                </tr>

                                <tr>
                                    <td class="col-sm-1 text-right">问题状态:</td>
                                    <td>
                                        <select name="info[question_status]" class="form-control" >
                                            <option value="">请选择</option>
                                            <volist name="q_status" id="vo">
                                                <option value="{$key}" <if condition="$key eq $info[question_status]">selected</if> >{$vo}</option>
                                            </volist>
                                        </select>
                                    </td>
                                    <td></td>
                                </tr>

                                <tr>
                                    <td class="col-sm-1 text-right">回答状态:</td>
                                    <td>
                                        <select name="info[answer_status]" class="form-control" >
                                            <option value="">请选择</option>
                                            <volist name="a_status" id="vo">
                                                <option value="{$key}" <if condition="$key eq $info[answer_status]">selected</if> >{$vo}</option>
                                            </volist>
                                        </select>
                                    </td>
                                    <td></td>
                                </tr>

                                <tr>
                                    <td class="col-sm-1 text-right">响应时间秒数:</td>
                                    <td>
                                        <input type="text" class="form-control" name="info[response_sec]" value="{$info.response_sec}">秒
                                    </td>
                                    <td></td>
                                </tr>

                                <tr>
                                    <td class="col-sm-1 text-right">提问时间:</td>
                                    <td>
                                        {$info.add_time|date="Y-m-d H:i:s",###}
                                    </td>
                                    <td></td>
                                </tr>


                            </table>
                            </tr>

                            </tbody>
                        </table>

                        <notempty name="has_answer">
                            <h3>回答信息：</h3>
                            <table class="table table-bordered">
                                <tbody>
                                <tr>
                                    <td class="col-sm-1 text-right">会计师名称:</td>
                                    <td>
                                        {$has_answer.username}
                                    </td>
                                    <td></td>
                                </tr>

                                <tr>
                                    <td class="col-sm-1 text-right">会计师手机:</td>
                                    <td>
                                        {$has_answer.mobile}
                                    </td>
                                    <td></td>
                                </tr>



                                <tr>
                                    <td class = "text-right">是否付费查看:</td>
                                    <td>
                                        <input name="has_answer[charge_view]" type="radio" value="1" <if condition="$has_answer['charge_view'] eq 1">checked</if> >是
                                        <input name="has_answer[charge_view]" type="radio" value="0" <if condition="$has_answer['charge_view'] eq 0">checked</if> >否
                                    </td>
                                    <td></td>
                                </tr>

                                <tr>
                                    <td class="col-sm-1 text-right">付费金额:</td>
                                    <td>
                                        <input type="text" class="form-control" name="has_answer[charge_money]" value="{$has_answer.charge_money}">
                                    </td>
                                    <td></td>
                                </tr>


                                <tr>
                                    <td class="col-sm-1 text-right">付费查看用户数量:</td>
                                    <td>
                                        {$has_answer.count}
                                    </td>
                                    <td></td>
                                </tr>


                                <tr>
                                    <td class="col-sm-1 text-right">回复内容:</td>
                                    <td>
                                        <textarea  class="form-control" name="has_answer[content]">{$has_answer.content}</textarea>
                                    </td>
                                    <td></td>
                                </tr>

                                <tr>
                                    <td class="col-sm-1 text-right">回答时间:</td>
                                    <td>
                                        <input type="text" class="form-control" id="add_time"  name="has_answer[add_time]" value="{$has_answer.add_time|date='Y-m-d H:i:s',###}">
                                    </td>
                                    <td></td>
                                </tr>


                                <tr>
                                    <td></td>
                                    <td>
                                        <input type="hidden" value="{$info.id}" name="info[id]" />
                                        <input type="hidden" value="{$has_answer.id}" name="has_answer[id]" />
                                        <input type="hidden" value="{$act}" name="act" />
                                        <button type="submit" class="btn btn-info">
                                            <i class="ace-icon fa fa-check bigger-110"></i> 保存
                                        </button>
                                    </td>
                                </tr>

                            </table>
                        </notempty>

                        <notempty name="no_answer">
                            <h3>尚未回答：</h3>
                            <table class="table table-bordered">
                                <tbody>
                                <tr>
                                    <td class="col-sm-1 text-right">会计师列表:</td>
                                    <td>
                                        <select name="no_answer[au_id]" class="form-control" >
                                            <option value="0">请选择</option>
                                            <volist name="account_users" id="vo">
                                                <option value="{$vo.au_id}"  <if condition="$vo[au_id] eq $no_answer[answer_id]">selected</if>>{$vo.username}[{$vo.mobile}]</option>
                                            </volist>
                                        </select>
                                    </td>
                                    <td>可以更改需要回答此问题的会计师</td>
                                </tr>

                                <tr>
                                    <td></td>
                                    <td>
                                        <input type="hidden" value="{$info.id}" name="info[id]" />
                                        <input type="hidden" value="{$no_answer.id}" name="no_answer[id]" />
                                        <input type="hidden" value="{$act}" name="act" />
                                        <button type="submit" class="btn btn-info">
                                            <i class="ace-icon fa fa-check bigger-110"></i> 保存
                                        </button>
                                    </td>
                                </tr>

                                </tbody>
                            </table>
                        </notempty>
                    </form>
                </div>
            </div>
        </div>
    </section>
</div>
<script>
    $(document).ready(function () {
        $('#stop_time,#add_time').daterangepicker({
            format : 'YYYY-MM-DD HH:mm',
            singleDatePicker: true,
            showDropdowns: true,
            timePicker : true,
            timePicker12Hour : false,
            timePickerIncrement : 1, //时间的增量，单位为分钟
            minDate: '2017/08/01',
            maxDate: '2030/01/01',
            locale: {
                applyLabel: '确定',
                cancelLabel: '取消',
                fromLabel: '起始时间',
                toLabel: '结束时间',
                customRangeLabel: '自定义',
                daysOfWeek: ['日', '一', '二', '三', '四', '五', '六'],
                monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
                firstDay: 1
            }
        });
    });

</script>
</body>

</html>
